home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F31700_testBuildListUntil.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  1.4 KB  |  41 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. xmlns:pGenerator="pGenerator"
  3. xmlns:pController="pController" 
  4. exclude-result-prefixes="xsl pGenerator pController"
  5. >
  6.   <xsl:import href="buildListUntil.xsl"/>
  7.   
  8.   <!-- This transformation does not depend on the source xml
  9.        on which to be applied. 
  10.        It will produce a list of 10 elements.
  11.     -->
  12.   
  13.   <xsl:output indent="yes" omit-xml-declaration="yes"/>
  14.   
  15.   <pGenerator:pGenerator/>
  16.   <pController:pController/>
  17.   
  18.   <xsl:variable name="vMyGenerator" select="document('')/*/pGenerator:*[1]"/>
  19.   <xsl:variable name="vMyController" select="document('')/*/pController:*[1]"/>
  20.   
  21.   <xsl:template match="/">
  22.       <xsl:call-template name="buildListUntil">
  23.             <xsl:with-param name="pGenerator" select="$vMyGenerator"/>
  24.             <xsl:with-param name="pController" select="$vMyController"/>
  25.       </xsl:call-template>
  26.   </xsl:template>
  27.  
  28.   <xsl:template name="listGenerator" match="*[namespace-uri()='pGenerator']">
  29.      <xsl:param name="pList" select="/.."/>
  30.      <xsl:param name="pParams"/>
  31.      
  32.      <xsl:value-of select="count($pList) + 1"/>
  33.   </xsl:template>
  34.   
  35.   <xsl:template name="listController" match="*[namespace-uri()='pController']">
  36.      <xsl:param name="pList" select="/.."/>
  37.      <xsl:param name="pParams"/>
  38.      
  39.      <xsl:if test="count($pList) = 10">1</xsl:if>
  40.   </xsl:template>
  41. </xsl:stylesheet>